package com.bite.demo.component;

import com.bite.demo.model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
public class UserComponent {
    public void sayHi() {
        System.out.println("hi,UserComponent");
    }








    //@Primary
    @Bean({"u1","u2"})
    public UserInfo userInfo( ) {
        return new UserInfo("zhangsan",12);
    }
    @Bean
    public UserInfo userInfo2( ) {
        return new UserInfo("lisi",12);
    }
}
